package cn.wolfcode.feign;

import cn.wolfcode.domain.Product;
import cn.wolfcode.feign.feignfallback.ProductFeignFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

// 指定远程调用的服务名，name的名称一定要和订单服务的服务名保持一致
// 和sentinel集成, 对服务容错性进行操作
@FeignClient(name = "product-service",fallback = ProductFeignFallBack.class)
public interface ProductFeign {

    @RequestMapping("product")
    Product findByPid(@RequestParam("pid") Long pid);
}
